package com.ruoyi.production.service.impl.fertilizer;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.production.domain.fertilizer.FertilizerPurchaseApply;
import com.ruoyi.production.mapper.fertilizer.FertilizerPurchaseApplyMapper;
import com.ruoyi.production.service.fertilizer.IFertilizerPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 化肥购买申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-11
 */
@Service
public class FertilizerPurchaseApplyServiceImpl implements IFertilizerPurchaseApplyService
{
    @Autowired
    private FertilizerPurchaseApplyMapper fertilizerPurchaseApplyMapper;

    /**
     * 查询化肥购买申请
     *
     * @param fertilizerPurchaseApplyId 化肥购买申请ID
     * @return 化肥购买申请
     */
    @Override
    public FertilizerPurchaseApply selectFertilizerPurchaseApplyById(Long fertilizerPurchaseApplyId)
    {
        return fertilizerPurchaseApplyMapper.selectFertilizerPurchaseApplyById(fertilizerPurchaseApplyId);
    }

    /**
     * 查询化肥购买申请列表
     *
     * @param fertilizerPurchaseApply 化肥购买申请
     * @return 化肥购买申请
     */
    @Override
    public List<FertilizerPurchaseApply> selectFertilizerPurchaseApplyList(FertilizerPurchaseApply fertilizerPurchaseApply)
    {
        return fertilizerPurchaseApplyMapper.selectFertilizerPurchaseApplyList(fertilizerPurchaseApply);
    }

    /**
     * 新增化肥购买申请
     *
     * @param fertilizerPurchaseApply 化肥购买申请
     * @return 结果
     */
    @Override
    public int insertFertilizerPurchaseApply(FertilizerPurchaseApply fertilizerPurchaseApply)
    {
        fertilizerPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return fertilizerPurchaseApplyMapper.insertFertilizerPurchaseApply(fertilizerPurchaseApply);
    }

    /**
     * 修改化肥购买申请
     *
     * @param fertilizerPurchaseApply 化肥购买申请
     * @return 结果
     */
    @Override
    public int updateFertilizerPurchaseApply(FertilizerPurchaseApply fertilizerPurchaseApply)
    {
        fertilizerPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return fertilizerPurchaseApplyMapper.updateFertilizerPurchaseApply(fertilizerPurchaseApply);
    }

    /**
     * 批量删除化肥购买申请
     *
     * @param fertilizerPurchaseApplyIds 需要删除的化肥购买申请ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerPurchaseApplyByIds(Long[] fertilizerPurchaseApplyIds)
    {
        return fertilizerPurchaseApplyMapper.deleteFertilizerPurchaseApplyByIds(fertilizerPurchaseApplyIds);
    }

    /**
     * 删除化肥购买申请信息
     *
     * @param fertilizerPurchaseApplyId 化肥购买申请ID
     * @return 结果
     */
    @Override
    public int deleteFertilizerPurchaseApplyById(Long fertilizerPurchaseApplyId)
    {
        return fertilizerPurchaseApplyMapper.deleteFertilizerPurchaseApplyById(fertilizerPurchaseApplyId);
    }
}
